/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package reportcenter.support.threading;

import java.util.TimerTask;
import org.springframework.richclient.util.EventListenerListHelper;

/**
 *
 * @author renan
 */
public class Job extends TimerTask implements WorkerJob {
    private EventListenerListHelper listeners = new EventListenerListHelper(JobListener.class);

    public void addJobListener(JobListener l) {
        listeners.add(l);
    }

    public void removeJobListener(JobListener l) {
        listeners.remove(l);
    }

    public void run() {
         listeners.fire("start");
//         listener.begin();
//         for (...) {
//              ...
//              listeners.fire("progress", new Integer(percentage));
//         }
//         ...
         
         
         System.out.println("testando spin threading support");
         listeners.fire("end");
    }
}
